<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<title>后台管理中心</title>
{$system_css}
{$system_js}
</head>
<body>
{include file="message.html"}
<div class="pad-lr-10" style="margin-top: 15px;">
  <table width="100%" cellspacing="0" class="search-form">
    <tbody>
      <tr>
        <td>
           <div class="explain-col">
             <a class="add fb" href="{$site_url}admin/ads/add/">
             <input type="button" name="search" class="button" value="添加广告" />
              </a>
              
              <form name="formsearch" action="{$site_url}admin/ads/search" method="post">
              搜索条件:所属分类
              <select name="ads_category">
                  <option value="0">====所有====</option>   
                  {$category_option}           
              </select>
              关键词:
              <input name="keyword" type="text" value="" class="input-text" />
              <input type="submit" name="search" class="button" value="搜索" />
              </form>
            </div>
         </td>
      </tr>
    </tbody>
  </table>
  <form name="myform" action="{$site_url}admin/ads/batch_position" method="post">
    <div class="table-list">
      <table width="100%" cellspacing="0">
        <thead>
          <tr>
            <th width="38">排序</th>
            <th width="45">ID</th>
            <th>所属分类</th>
            <th>广告名字</th>
            <th>广告链接</th>
            <th>添加时间</th>
            <th>管理操作</th>
          </tr>
        </thead>
        <tfoot>
          <tr align="right">
            <td colspan="7">{$page}</td>
          </tr>
        </tfoot>
        <tbody>
        
        {foreach from=$ads_list item=list}
        <tr>
          <td align="center"><input type="text" class="input-text-c input-text" value="{$list.position}" size="4" name="position[{$list.id}]"></td>
          <td align="center">{$list.id}</td>
          <td align="center">{$list.category_name}</td>
          <td align="center">{$list.name|truncate:10}</td>
          <td align="center">{$list.url}</td>
          <td align="center">{$list.add_time|date:2}</td>
          <td align="center"><a href="{$site_url}admin/ads/edit/{$list.id}">修改</a> | <a href="javascript:void(0);" class="delete" title="{$list.name}" id="{$list.id}">删除</a></td>
        </tr>
        {/foreach}
          </tbody>
        
      </table>
      <div class="btn">
        <input type="submit" class="button" name="dosubmit"  value="排序"/>
      </div>
      <div id="pages"></div>
    </div>
  </form>
</div>
<script type="text/javascript">
$(function(){
	$('.delete').click(function(){
		var title = $(this).attr('title');
		var id = $(this).attr('id');
		$.dialog.confirm('你确定要删除<font color=red>'+title+'</font>吗？', function(){
			location.href="{$site_url}admin/ads/delete/"+id;
		}, function(){
		});
	   
	});
});          
</script>
</body>
</html>